package com.example.m1;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
@RabbitListener(queues = "helloworld") //rabbit监听
public class Consumer {
    @RabbitHandler//rabbit处理器
    public void receive(String msg) {
        System.out.println("收到: "+msg);
    }


}
